package gat.common.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * @Author sxq
 * @Date 2022/5/10
 * @Version 1.0
 */
@NoArgsConstructor
@AllArgsConstructor
@Getter
public enum ESignTypeEnums {

    bank("bank", "认证服务四要素(银行卡)", "personal_bank_element"),
    phone("phone", "认证服务三要素(手机号)", "personal_operator_element"),
    card("card", "个人二要素(身份证)", "personal_second_element"),
    face("face", "人脸认证", "personal_face_check"),
    tencent_face("tencent_face", "人脸认证-腾讯", "tencent_face_check");

    private String code;

    private String value;

    private String type;

    @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
    public static ESignTypeEnums getByCode(@JsonProperty("code") String code) {
        for (ESignTypeEnums value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }

}
